<?php
/**
 * Created by PhpStorm.
 * User: 26243
 * Date: 2017/5/6
 * Time: 16:40
 */
require_once '../include.php';
session_start();
$arr = $_POST;
$arr['listime'] = time();
$userid = $_SESSION['loginFlag'];
$arr['userid'] = $userid;
$arr['namepro'] = 0;
$arr['numpro'] = 0;
global $link;
$keys = "".join(",", array_keys($arr));
$vals = "'" . join("','", array_values($arr)) . "'";
$sql = "INSERT INTO shop_list ({$keys}) VALUES ({$vals})";
$result=mysqli_query($link, $sql);
if($result){
    $mes="订单提交成功<br/>3秒钟后跳转到首页<meta http-equiv='refresh' content='3;url=index.php'/>";
}else{
    $mes="订单提交失败<a href='shop_checkout.php'>返回</a>";
}
echo $mes;